CXX      := g++
CXXFLAGS := -std=c++17 -Wall -Wextra -O2 -pthread

SRC := \
    acceptor.cpp \
    echo_connection.cpp \
    event_handler.cpp \
    event_loop.cpp \
    event_loop_thread.cpp \
    event_loop_thread_pool.cpp \
    thread_pool.cpp \
    main.cpp

OBJ := $(SRC:.cpp=.o)

TARGET := reactor_server

all: $(TARGET)

$(TARGET): $(OBJ)
	$(CXX) $(CXXFLAGS) -o $@ $^
	rm -f $(OBJ)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
	rm -f $(OBJ) $(TARGET)

.PHONY: all clean